mat2ds

D = mat2ds(mat [,txt]; x=nothing, text=nothing, multi=false, geom=0, kwargs...)

Take a 2D mat array and convert it into a GMTdataset. x is an optional coordinates vector (must have the same number of elements as rows in mat). Use x=:ny to generate a coords array 1:n_rows of mat. Alternatively, if mat is a string or vector of strings we return a dataset with NaN’s in the place of the coordinates. This form is useful to pass to text when using the region_justify option that does not need explicit coordinates to place the text.

D = mat2ds(mat::Array{T,N}, D::GMTdataset)

Take a 2D mat array and convert it into a GMTdataset. Pass in a reference GMTdataset from which we’ll take the georeference info as well as attrib and colnames.

D = mat2ds(mat::Vector{<:AbstractMatrix}; hdr=String[], kwargs...)::Vector{GMTdataset}

Create a multi-segment GMTdataset (a vector of GMTdataset) from matrices passed in a vector-of-matrices mat. The matrices elements of mat do not need to have the same number of rows. Think on this as specifying groups of lines/points each sharing the same settings. KWarg options of this form are more limited in number than in the general case, but can take the form of a Vector{Vector}, Vector or scalars. In the former case (Vector{Vector}) the length of each Vector[i] must equal to the number of rows of each mat[i].

D = mat2ds(D::GMTdataset, inds::Tuple)::GMTdataset

Cut a GMTdataset D with the indices in INDS but updating the colnames and the Timecol info. INDS is a Tuple of 2 with ranges in rows and columns. Ex: (:, 1:3) or (:, [1,4,7]), etc… Attention, if original had attributes other than ‘Timeinfo’ there is no guarentie that they remain correct.

Example

Create a 3 elements vector with a color and transparency each.

using GMT
D = mat2ds([rand(6,3), rand(4,3), rand(3,3)], fill=[[:red], [:green], [:blue]], fillalpha=[0.5,0.7,0.8]);

# Now see it
viz(D)

See Also

mat2grid, mat2img